Skip to content

test(ingestion): cover the Dagster assets - #861

Merged
jirhiker merged 1 commit into
stagingfrom
test/ingest-asset-coverage
Aug 19, 2026
Merged

test(ingestion): cover the Dagster assets#861
jirhiker merged 1 commit into
stagingfrom
test/ingest-asset-coverage

Conversation

@jirhiker

Copy link
Copy Markdown
Member

ingest.py was at 16%. Now 87%; automated_ingestion overall 83% → 88%.

Every part of san_acacia_observations was already covered on its own —
matching, resolving, watermarks, the adapter, the loader. What was not covered
was the orchestration between them, which is where the decisions live: which
wells get skipped, what the metadata reports, and whether one unresolvable well
costs the others.

Fakes only at the process boundaries

The vendor client, the database session, and the dlt pipeline are faked. The
reconciler, resolver and adapter run for real, so a change in their
behaviour surfaces here rather than being absorbed by a mock.

What is now pinned

behaviour why it matters
No match → skipped Ingestion does not create wells
Two wells share a name → skipped Picking one would be a silent guess
No open transducer → skipped SO-0246 is in this state in production
Removed transducer → not a fallback Writing to retired kit looks like success
Refused reading → counted A null level should surface, not vanish
One bad well → others still load The point of skipping rather than raising
Both raw assets write parquet dlt defaults to JSONL; replay assumes parquet
A point the vendor refuses → counted One diver failing must not cost the run

What remains uncovered, deliberately

_client and the two SQLAlchemy query helpers (_well_candidates,
_deployments). They are thin wrappers around a live database and a real HTTP
session — testing them would mean asserting that mocks were called, which proves
nothing about whether the queries are right.

The honest measure of what is still unproven is that the pipeline has never run
end to end against the database. These tests do not change that; they make the
skip-and-report logic verifiable without it.

124 tests pass.

🤖 Generated with Claude Code

ingest.py was at 16%. Every part of san_acacia_observations was covered on its
own -- matching, resolving, watermarks, the adapter, the loader -- but the
orchestration between them was not, which is where the decisions live: which
wells get skipped, what the metadata reports, and whether one unresolvable well
costs the others.

Now 87%, and automated_ingestion overall 83% to 88%.

Fakes stand in at the process boundaries only -- the vendor client, the database
session, the dlt pipeline. The reconciler, resolver and adapter run for real, so
a change in their behaviour surfaces here rather than being absorbed by a mock.

Covered: a well with no match is skipped rather than invented; two wells sharing
a name are skipped rather than picked between; a well with no open transducer,
and one whose transducer was removed, are skipped; a refused reading is counted
rather than vanishing; one bad well does not cost the others; both raw assets
write parquet; a point the vendor refuses is counted and reported.

What remains uncovered is _client and the two SQLAlchemy query helpers. They
are thin wrappers around a live database and a real HTTP session, and testing
them would mean asserting that mocks were called.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Coverage

78.59% total — gate is 75%.

No measured coverage for the Python files changed here.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
ocotillo-automated-ingestion View in Cloud Aug 19, 2026 at 07:34 PM (UTC)

@jirhiker
jirhiker merged commit dac1519 into staging Aug 19, 2026
10 checks passed
@jirhiker
jirhiker deleted the test/ingest-asset-coverage branch August 19, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant